<?php  

$output				= '';
$content			= $this->layout()->content;
$CSS				= $this->placeholder('css');
$ERROR_num			= $this->placeholder('errorNumber');
$ERROR_desc			= $this->placeholder('errorDescription');
$role				= $this->placeholder('role');
$show_content		= $content != '';

//	Error
$output				.= '<status code="'.$ERROR_num.'"'.($role == 'admin' ? ' role="admin"' : '').'>';

//	Error description
$output				.= '<![CDATA[';
$output				.= $ERROR_desc;
$output				.= ']]>';

$output				.= '</status>';

//	Content
if($show_content && $ERROR_num == '0')
{
	$output			.= '<content>';
	$output			.= $content;
	$output			.= '</content>';
}

//	CSS
$css				= $CSS != '' ? '<?xml-stylesheet type="text/css" href="'.$CSS.'"?>' : '';

//	Print responce
echo '<?xml version="1.0" encoding="UTF-8" ?>'.$css.'<data>'.$output.'</data>';